package com.o2o.dao;

import com.o2o.entity.LocalAuth;
import org.apache.ibatis.annotations.Param;

import java.util.Date;

/**
 * package_name:com.o2o.dao
 * Author:徐亚远
 * Date:2019/12/25 19:14
 * 项目名:o2o
 * Desription:
 **/
public interface LocalAuthDao {
    /*
    * 通过账户和密码查询信息,登录用
    * @param username
    * @param password
    * @return
    * */
    LocalAuth queryLocalByUserNameAndPwd(@Param("username") String username, @Param("password") String password);

    /*
    * 通过用户Id查询对应localAuth
    * @param userId
    * @return
    * */
    LocalAuth queryLocalByUserId(@Param("userId") long userId);

    /*
    *
    * 添加平台账户
    * @param localAuth
    * @return*/
    int insertLocalAuth(LocalAuth localAuth);
    /*
    *通过userId,username,password更改密码
    * @param localAuth
    * @return
    * */
    int updateLocalAuth(@Param("userId") long userId,
                        @Param("username") String username,
                        @Param("password") String password,
                        @Param("newPassword") String newPassword,
                        @Param("lastEditTime") Date lastEditTime);
}
